<script setup lang="ts">
import { reactive } from 'vue';

var user = reactive({
    id:1,
    username:'张三',
    age:18
  })

var clazz = reactive(['课程1','课程2','课程3','课程4'])

const changePeople = () => {
  Object.assign(user,{
    id:2,
    username:'李四',
    age:99
  })
}

</script>
<template>
  <div>{{ user }}</div>
  <button @click="changePeople">换人</button>
  <ul>
    <li v-for="item in clazz" :key="item">
      {{ item }}
    </li>
  </ul>
</template>
<style scoped></style>